<html>
<head><meta charset="utf-8"><title>RFC 2497 · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html">RFC 2497</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="214118496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214118496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214118496">(Oct 21 2020 at 21:42)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/53667">https://github.com/rust-lang/rust/issues/53667</a></p>
<p>I might take a stab at this feature but I need mentorship because It is been a while since I worked on lang stuff. Anyone interested?</p>



<a name="214118727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214118727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214118727">(Oct 21 2020 at 21:45)</a>:</h4>
<p>Wasn't <span class="user-mention" data-user-id="116107">@davidtwco</span> interested in working on if-let chains? Maybe they can help</p>



<a name="214118949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214118949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214118949">(Oct 21 2020 at 21:47)</a>:</h4>
<p>I didn’t get around to working on it, <span class="user-mention" data-user-id="125294">@Aaron Hill</span> expressed interest in <a class="stream-topic" data-stream-id="131828" href="/#narrow/stream/131828-t-compiler/topic/let.20chains">#t-compiler &gt; let chains</a>.</p>



<a name="214119285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214119285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214119285">(Oct 21 2020 at 21:50)</a>:</h4>
<p>I guess you're first going to need to change the parser and AST to implement the <a href="https://github.com/rust-lang/rfcs/blob/master/text/2497-if-let-chains.md#grammar">grammar changes</a></p>



<a name="214119833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214119833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214119833">(Oct 21 2020 at 21:56)</a>:</h4>
<p>And then you'll have to implement the desugaring in the AST -&gt; HIR step</p>



<a name="214120819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214120819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214120819">(Oct 21 2020 at 22:05)</a>:</h4>
<p>Hum... IIRC, there are now two parsers: (1) From rust-analyzer and (2) The traditional parser</p>



<a name="214120887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214120887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214120887">(Oct 21 2020 at 22:05)</a>:</h4>
<blockquote>
<p>And then you'll have to implement the desugaring in the AST -&gt; HIR step</p>
</blockquote>
<p>I hope it's that easy :)</p>



<a name="214120973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214120973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214120973">(Oct 21 2020 at 22:06)</a>:</h4>
<p>Otherwise it's no fun :)</p>



<a name="214121602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214121602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214121602">(Oct 21 2020 at 22:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211466">Caio</span> <a href="#narrow/stream/122651-general/topic/RFC.202497/near/214120819">said</a>:</p>
<blockquote>
<p>Hum... IIRC, there are now two parsers: (1) From rust-analyzer and (2) The traditional parser</p>
</blockquote>
<p>There are plans to have a unified parser library (cc <a class="stream" data-stream-id="254930" href="/#narrow/stream/254930-t-compiler.2Fwg-parselib">#t-compiler/wg-parselib</a>) but I guess it's still far from happening</p>



<a name="214123412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214123412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214123412">(Oct 21 2020 at 22:33)</a>:</h4>
<p>Desugar happens <a href="https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_ast_lowering/expr.rs.html#317-360">here</a> for <code>if</code>s and <code>if let</code>s</p>



<a name="214123563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214123563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214123563">(Oct 21 2020 at 22:34)</a>:</h4>
<p>So for the <code>if let</code> chains I think it could be possible to just have a recursive function that eats the conditions one by one</p>



<a name="214123577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214123577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214123577">(Oct 21 2020 at 22:35)</a>:</h4>
<p>I'm no compiler expert though :)</p>



<a name="214124869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214124869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caio <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214124869">(Oct 21 2020 at 22:51)</a>:</h4>
<p>Hehehehe, thanks <span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> ! Looks like there is a long road ahead</p>



<a name="214271084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214271084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214271084">(Oct 23 2020 at 03:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211466">Caio</span> <a href="#narrow/stream/122651-general/topic/RFC.202497/near/214124869">said</a>:</p>
<blockquote>
<p>Hehehehe, thanks <span class="user-mention silent" data-user-id="255061">LeSeulArtichaut</span> ! Looks like there is a long road ahead</p>
</blockquote>
<p>I've wanted this several times just in the last few <em>days</em>, and I'd love to see it.</p>



<a name="214271090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/RFC%202497/near/214271090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/RFC.202497.html#214271090">(Oct 23 2020 at 03:54)</a>:</h4>
<p>Thank you for considering working on it. :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>